package com.bw.bean;

import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Aspect;
import org.springframework.stereotype.Component;

@Aspect
@Component
public class Aop {

    public Object arund(ProceedingJoinPoint proceedingJoinPoint) throws Throwable {
        long l = System.currentTimeMillis();
        String name = proceedingJoinPoint.getSignature().getName();
        Object proceed = proceedingJoinPoint.proceed();
        long l2 = System.currentTimeMillis();
        System.out.println("方法:"+name+"执行了:"+(l2-l)+"毫秒");
        return proceed;
    }
}
